﻿using System.Runtime;

namespace WJP.Utils
{
    /// <summary>
    /// bool 值的装箱值
    /// </summary>
    public static class BooleanBoxes
    {
        /// <summary>The true</summary>
        public static readonly object True = true;

        /// <summary>The false</summary>
        public static readonly object False = false;

        /// <summary>Boxes the specified bool value.</summary>
        /// <param name="value">if set to <c>true</c> [value].</param>
        /// <returns></returns>
        [TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
        public static object Box(this bool value)
        {
            return value ? True : False;
        }
    }
}